package com.ds.components.ui;

import javax.swing.*;
import javax.swing.plaf.basic.BasicButtonUI;
import java.awt.*;

public class MyButtonUI extends BasicButtonUI
{
	/* (non-Javadoc)
	 * @see javax.swing.plaf.basic.BasicButtonUI#paint(java.awt.Graphics, javax.swing.JComponent)
	 */
	@Override
	public void paint( Graphics g, JComponent c )
	{
		Graphics2D g2D = ( Graphics2D ) g;
		g2D.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );

		super.paint( g2D, c );
		g2D.setColor( Color.orange );
		g2D.fillOval( 0, ( c.getHeight() - 12 ) / 2, 12, 12 );

		if( ( ( JRadioButton ) c ).isSelected() )
		{
			g2D.setColor( Color.black );
			g2D.fillOval( 2, ( c.getHeight() - 8 ) / 2, 8, 8 );
		}
	}
}
